﻿@model ITStore.ViewModels.ChiTietBaiVietViewModel

@{
    ViewBag.Title = @Html.DisplayFor(model => model.ChiTietBV.bv_TieuDe);
}
<script src="@Url.Content("~/Scripts/tinymce/tiny_mce.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/tinymce/tiny_mce_popup.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/tinymce/tiny_mce_src.js")" type="text/javascript"></script>
<script type="text/javascript">
    tinyMCE.init({
        mode: "textareas"
    });
</script>
<h2>@Html.DisplayFor(model => model.ChiTietBV.bv_TieuDe)</h2>
<div style="font-style:italic;font-size:smaller">@Html.DisplayFor(model => model.ChiTietBV.LoaiBaiViet.lbv_Loai) - @Html.DisplayFor(model => model.ChiTietBV.bd_Ngay)</div>
<br />
<fieldset>
    <legend style="color:Blue">Nội dung thông tin</legend>
    <br />
    <div class="display-field">
        @Html.DisplayTextFor(model => model.ChiTietBV.bv_NoiDung)
    </div>
    <br />
</fieldset>
<fieldset>
<legend style="color:Blue">Bình luận</legend>
<div>
<ul>
    @foreach (var item in Model.DanhSachBinhLuan)
    {
        <li><div style="font-weight:bold">@Html.Raw(@item.blbv_NoiDung)</div><div style="font-style:italic;font-size:smaller">Ngày đăng : @item.blbv_NgayDang -- @Html.ActionLink("Xóa", "DeleteBinhLuan", new { id = @item.blbv_ID })</div></li>
    }
</ul>
</div>
</fieldset>
<br />
<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount
     
    @if (Model.PageNumber > 1)
    {
        @Html.ActionLink("<<", "Details", new { page = 1, id = Model.ChiTietBV.bv_ID })
        @Html.Raw(" ");
        @Html.ActionLink("< Lùi lại", "Details", new { page = Model.PageNumber - 1, id = Model.ChiTietBV.bv_ID})
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev
    }
     
    @if (Model.PageNumber < Model.PageCount)
    {
        @Html.ActionLink("Tiếp theo >", "Details", new { page = Model.PageNumber + 1, id = Model.ChiTietBV.bv_ID })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Details", new { page = Model.PageCount, id = Model.ChiTietBV.bv_ID })
    }
    else
    {
        @:Next >
        @Html.Raw(" ")
        @:>>
    }
</div>
<br />
<fieldset>
<legend style="color:Blue">Thêm bình luận</legend>
@using (Html.BeginForm())
{
    <p>     
                <textarea name="content" cols="81" rows="5">Nhập nội dung bạn muốn bình luận vào đây !</textarea>
                <input type="submit" value="Bình luận" />
    </p>
}
</fieldset>
<p>
    @Html.ActionLink("Sửa", "Edit", new { id=Model.ChiTietBV.bv_ID }) |
    @Html.ActionLink("Quay lại danh sách", "Index")
</p>